Import and Export Content
Import/Export (Impex) Overview
The purpose of the Resolve Actions Pro Import/Export Module is to archive or transfer any Actions Pro component. Use Import/Export to:
- Create a backup of your Runbooks, ActionTasks, properties, and other document pages or files.
- Copy your wiki documents, ActionTasks, and Runbooks to another Actions Pro installation, such as a backup machine or a new installation.
- Add modules to Actions Pro, such as new adaptors or other new modules or code.
Impex is a term used for Import/Export.
You can upload only one zip file at a time. Actions Pro does not currently support multiple uploads.
The Import-Export Log is a convenient log that lists all importing and exporting activities. For more information about the Import/Export Module, including how to create a new module for export, see the Import Export Module that is part of this document.
Additionally, check the Actions Pro Docks Converter utility, available herein, as well as the Impex Components for specific information about exporting components.
Importing content in Actions Pro sub-namespace (includes sub-namespaces in system namespace as well) is allowed only for the resolve.maint user.
Import/Export Naming Conventions
The following are guidelines for naming Import or Export modules:
- In general, try to use the same name as the namespace of the Runbooks and ActionTasks you are exporting.
- Avoid any special characters (especially the "$" in UNIX environments) in names. Do NOT use apostrophes ( ' ). However, using periods (. ), underscores ( _ ), or spaces are acceptable.
- Have in mind that Import/Export module names are case-sensitive.
Import/Export (Impex) Module
To access the Actions Pro Import Export Module, go to Main Menu > Import Export > Import Export Module.
The Import/Export list displays all Actions Pro modules available for importing or exporting.
To execute main Impex operations, select the desired module and click on the corresponding button at the top of the list.
To delete an Impex module:
Select one or more modules and click the Delete button to delete the selections.
To download an Impex module:
- Select the desired zip file.
- Click the name of the file when it becomes underlined.
To create a new Impex module:
- Click New to open the Import/Export Definition screen.
- Fill in the definition fields as described below.
Field | Description |
---|---|
Name | Impex module name |
Forward To | Specify a wiki document name to forward to when this package is imported |
Script Name | Specify a script name to be executed after this package is imported |
Description | Impex module description, for identification and convenience |
Uploading a Module
To import a module for the first time, you must upload it first. To do it:
- In the Import/Export list, click the Upload button. The Upload Module dialog box opens.
- Either browse your local file system for the file or drag-and-drop it onto the designated area.
The module must be in a zip file. - Once uploaded, a module is automatically imported and displayed in the Import/Export list for importing again in the future. That is usually needed for a fresh re-install of clean Runbooks or ActionTasks that have been incorrectly edited or modified.
Import (Re-Import)
Importing does not overwrite nor delete any pre-existing Actions Pro components. The newly imported content is added as a new latest version on top of the pre-existing object. If the imported object does not exist yet, it will be imported as the first committed version.
- Pre-existing Actions Pro objects are assigned a Version on import.
- All imported versions are marked as committed versions.
- If the Action Task or Runbook object that is imported does not exist on the target environment it is imported as committed Version # 1.
- If the Action Task or Runbook object that is imported already exists on the target environment it is imported as Version N+1, where N is the latest existing version on the target environment.
- The imported versions always have system-generated comments: Imported from the module: "import module name"
To re-import a module that was previously imported:
- Select а module from the Import/Export list.
Before importing a module again, back up (export) any Actions Pro components as necessary. - Click the Import button.
- Click the Manifest button.
The Manifest dialog box displays the different components (DB, Wiki, Assessor etc.) of the selected module. - Select a specific component or components to import (by default, all components are selected).
Optionally, click Verify to check if the components already exist on the current system and whether a component is the same version or different. Details are populated under the Status column. - Click Import.
After the import is initiated, it cannot be canceled, so ensure that you are about to import the correct module. You can watch the import progress in the dialog box that appears.noteClicking the Close button does not abort the import operation, which cannot be canceled, but just makes the status dialog box disappear.
- After the import completes, click Result to view the result of every imported (or exported) module component in a dialog box.
Any error or warning message is logged. Detailed errors can be found in the "rsview.log" file residing under the "tomcat/logs" folder.
Multiple import and export operations at the same time are allowed. However, only one of those operations is performed at any given time: all requests are queued and served on a first-come, first-served basis.
- If another Impex task is already in progress when an Impex operation is started, then that operation is placed in a queue and the status of the ongoing operation is shown in the status dialog box.
- As soon as the ongoing operation finishes, the desired pending task initiates with its status shown.
If a current import halts for any reason, then the operation waits for 5 minutes to see a progress update. If nothing continues to happen, then it aborts the halted operation. Рemember that re-importing modules will add one new committed version on top of the already existing components which already exist. If the error message Failed to import module: <module name> <file path> (No such file or directory)
appears when importing, then the file is not in the correct folder or the name is incorrect.
Export
Any combination of Actions Pro system components, including wiki documents, scripts, ActionTasks, Runbooks, and others, can be exported as an Impex module. Actions Pro allows exporting of custom images added to the automation models.
- Select any existing module from the Import/Export list and click the Export button, or create a brand new module definition for export with the New button.
- Similar to the import process, the export screen provides the option to check the components manifest.
- The export zip file is created with the latest version of each component specified for export.
When the process is complete, you can check the export results using the Result button, or you can download the zip file using the Download button.
- The completed zip file can always be downloaded again from the Import/Export list by clicking the underlined zip file name.
- After downloading, the zip file can also then be imported to any other Actions Pro directory.
Import/Export Components
An import/export module consists of a combination of various Actions Pro components, such as multiple ActionTasks or Runbooks. For existing modules listed in the "Import/Export" list of the Import-Export Module, you can always check the components by clicking the View Details icon in front of the desired module.
The module components can also be checked during the importing or exporting process using the Manifest button from either the Import or Export dialog box.
New: This button is used to create a brand new module for export. Click the button in the Import/Export list to bring up the Import/Export Definition screen, or click the View Details icon next to an existing module to modify its definition.
Add: This button is available under the Components section. Click it to open the Add Components dialog box. The Type drop-down menu lists all the different Actions Pro component types that can be incorporated in an Import/Export module. Every time a component type is selected, the Add Components window displays a list of available components to include.
Example: Adding a Component to an Impex Module
For the purpose of the example, we will export ActionTasks.
Select ActionTask from the drop-down at the upper-left corner and then select the ActionTask sub-type. Тhe grid is auto-populated with all ActionTasks available in the system.
- The paginated result appears,, with 50 entries listed on each page. Other pages are accessible via the pagination navigator.
- Select one or more ActionTasks.
- To search for a specific ActionTask, type its name in the search box. Different components use different search criteria. As the query is input into the search field, Actions Pro will auto-suggest values to be queried. The query drop-down also displays an Advanced Search dialog box.
- Switch from Selections to the Options tab to show the options for the specific component type.
Select one or more ActionTask components to add to the impex module (using the Ctrl key of the keyboard for multiple selections) and Add them to the module definition. Close the components dialog box and then Save the module definition. Also, a tab labeled ActionTask is created in the Components section, which lists all the ActionTasks selected to export in the module. Many different tabs are created as different components are selected for export. The following sample impex module has ActionTask, Catalog, Form, User, and Wiki components.
A newly created module definition does not yet have a zip file available for download. If any existing exported/imported module is re-saved after changes, then the file name is removed, so the definition must be exported again to create the zip file.
So both new and modified modules must be exported to populate the zip file.
To add Component/Type to Set the Component Options, follow these steps:
- From the Main Menu, select the Import Export Module.
- Click New to create an Import/Export definition.
- Enter a Name for the definition and Save it.
- In the Components section of the Impex module definition screen, click the Edit icon next to a component to open the Set Component Options dialog box and finally.
- Each component type (whether ActionTask, Catalog, Form, User, or Wiki) has its own set of available options.
- Component options can be altered after an Impex module definition is created, but the entire definition must be saved after any changes are made.
- Use the drop-down to select a Category. The additional items appear next to the selections.
- Click Set Options.
Export Options
The version of the exported components is the latest version created so far.
The following table lists the available export options:
Component Type | Options | Default | Description |
---|---|---|---|
ActionTask | |||
Include Properties | true | Export Actions Pro Properties available in ActionTask Content, Assessor, Preprocessor, Parser, and Parameters.Runbooks do not have an explicit "Include Properties" export option. Export of Action Task properties that are part of a Runbook model is controlled through a global system property impex.export.properties . Default value is "true". The Action Task properties as part of a Runbook are not exported when impex.export.properties is set to "false". impex.export.properties system property takes precedence over the Include properties ActionTask export option. The Include properties export option applies only to stand alone tasks, not part of an exported Runbook. See use cases below Table 2. | |
Exclude Referenced Assessors | false | Exclude any referenced Assessors while exporting ActionTasks. ActionTasks from old Actions Pro versions (before 3.4.2) might reference externally-defined Assessors. The default option (unchecked) provides backwards-compatibility. | |
Exclude +Referenced Parsers | false | Exclude referenced Parsers while exporting ActionTasks. The default option (unchecked) provides backwards-compatibility. | |
Exclude Referenced Preprocessors | false | Exclude referenced Preprocessor while exporting ActionTask. The default option (unchecked) provides backwards-compatibility. | |
ActionTask Module | |||
Meaning | All ActionTasks in module are exported. | ||
Include Properties | true | Same as with ActionTask. | |
Exclude Referenced Assessors | false | Same as with ActionTask. | |
Exclude Referenced Parsers | false | Same as with ActionTask. | |
Exclude Referenced Preprocessors | false | Same as with ActionTask. | |
Business Rule | |||
Meaning | See System Administration main menu for Business Rules, which are contingent system scripts. | ||
Catalog | |||
Include Wikis | false | Export all referenced wiki document pages. | |
Export Reference Catalos | true | Export all referenced catalos. | |
Custom DB | |||
Meaning | Custom DB type lets user export any table from Actions Pro. Specify the table name and optionally specify the WHERE clause to export any specific rows and if omitted, entire table will be exported. NOTE: Although any table can be exported, but Custom Tables and Impex definition tables (RESOLVE_IMPEX_MODULE, RESOLVE_IMPEX_GLIDE, and RESOLVE_IMPEX_WIKI) are strongly discouraged from exporting this way. | ||
Custom Table | |||
Include Custom Forms | true | Export associated Custom Form. | |
Include Data | false | Export all data stored in the Custom Table. | |
Form | |||
Include Custom Tables | false | Export associated Custom Table. | |
Include Runbooks | true | Export associated Runbooks. | |
Include System Scripts | true | Export associated System Scripts. | |
Forum | |||
Include User Members | true | Export all Users who are following this Forum. | |
Group | |||
Include Users Relations | false | Export Group-User relationship. | |
Include Role Relation | false | Export Group-Role relationship. | |
Menu Definition | |||
Include Menu Item | false | Export corresponding Menu Items of this Menu Definition. | |
Menu Item | |||
Menu Set | |||
Include Menu Set | false | Export corresponding Menu Section (Definition) of this Menu Set. | |
Process | |||
Include Wiki/Runbook | true | Export wiki documents and Runbook(s) which are part of this Process. | |
Include User Members | true | Export User(s) which are following this Process. | |
Include Team | true | Export Team(s) which are part of this Process. | |
Include Forum | true | Export Forum(s) which are part of this Process. | |
Include RSS | true | Export RSS(s) which are part of this Process. | |
Include ActionTask | true | Export ActionTask(s) which are part of this Process. | |
Property | |||
Role | |||
Include User Relations | false | Export User-Role relationship. | |
Include Group Relations | false | Export User-Group relationship. | |
RSS | |||
Scheduler | |||
Meaning | Specify a Cron job. | ||
System Property | |||
System Script | |||
Tag | |||
Meaning | Specify one or more tags to include. Using this option includes any component (other than a Runbook). | ||
Team | |||
Include User Members | true | Export User(s) which are following this Team. | |
Include Sub Teams | false | Export all Team(s) which are part of this Team. | |
User | |||
Include Role Relations | false | Export User-Role relationship. | |
Include Group Relations | false | Export User-Group relationship. | |
Insert Only Definition | false | Generate INSERT only XML definition meaning record will be inserted in database rather updated. | |
Wiki | |||
Include sub-Runbooks and Decision Tree | true | Export complete hierarchy of sub-Runbook(s) and Decision Tree(s). | |
Include Tags | true | Export all wiki document tags | |
Include Custom Forms | false | Export all Forms. Default options of Form will be applied while exporting Form(s). | |
Include ActionTasks | true | Export all ActionTask(s) referred in all automation(s) and Wiki content. Default options of ActionTask are applied. | |
Include Catalogs | false | Export all referred CatLog(s). Default CatLog options are applied. | |
Delete if Same Document ID* | false | Option evaluated when importing module: delete original wiki document if importing document has same mysid as that of original document. | |
Delete if Same Document Name* | false | Option evaluated when importing module: delete original wiki document if importing document has same full name as that of original document. | |
Wiki Lookup | |||
Meaning | Specify one or more Wiki lookup definitions to include. | ||
Wiki Namespace | |||
Meaning | Export all wiki document(s) from this Namespace. | ||
Include ActionTasks | true | Same as that of wiki document export. | |
Include Sub Runbooks and Sub Decision Tree | true | ||
Include Tags | true | ||
Include Custom Forms | false | ||
Delete if Same Document ID | false | ||
Delete if Same Document Name | false | ||
Start DateEnd Date | If both Start and End date is mentioned, export all wiki document(s) which are updated between these dates. If only Start date is mentioned, export all wiki document(s) which are updated after or on Start date. If only End date is mentioned, export all wiki document(s) which are updated earlier or on End date. | ||
Wiki Template | |||
Include Form | true | Export all referred Form(s). Default Form options are applied. | |
Include Template Wiki | true | Export all referred wiki document(s). Default wiki document options are applied. |
Use cases related to Include Properties Action Task export option and impex.export.properties system property:
- Include properties task option = true by default
- impex.export.properties =true by default
Export of stand-alone Action Tasks only:
- Include properties =true => all properties part of the task are exported
- Include properties =false => no properties part of the task exported
Export of Runbooks with Action Tasks in any of the models (The main model, Abort model, Decision tree) that include properties :
- System property impex.export.properties =true => all task properties are exported
- System property impex.export.properties =false => no task properties are exported
Export of stand-alone Action Tasks with properties and export of Runbooks with same tasks that include same properties:
- Include properties =true & system property impex.export.properties =true => all task properties are exported
- Include properties =false & system property impex.export.properties =false => no task properties are exported
- Include properties =false & system property impex.export.properties =true => no task properties are exported . The user manual preference in the export options takes precedence over the sys property.
- Include properties =true & system property impex.export.properties =false => all task properties are exported. The user manual preference in the export options takes precedence over the sys property.
Export of stand-alone Action Tasks with properties and export of Runbooks with different tasks that include same properties :
- Include properties =true & system property impex.export.properties =true => all task properties are exported from both
- Include properties =false & system property impex.export.properties =false => no task properties are exported from neither
- Include properties =false & system property impex.export.properties =true => no properties from the stand-alone tasks are exported. All task properties part of the tasks in the Runbooks is exported.
- Include properties =true & system property impex.export.properties =false => all properties from the stand-alone tasks are exported. No tasks properties part of the tasks in the Runbooks is exported.
Actions Pro Docx Converter
The Actions Pro Docx Converter is a simple, command-line admin tool that will convert ".Docx" documents into Actions Pro Runbook Impex modules.
Users who are new to Actions Pro may have certain proprietary task instructions in Microsoft Word or Google Documents available to their team members. In some cases, it would be useful to have those documents brought into a Actions Pro Runbook as a template for new automations, checklists, or linkable documentation. Instead of rebuilding each document from scratch, the Docx Converter conveniently converts those old documents into a Actions Pro-friendly format.
The Actions Pro Docx Converter is accessible through an RSConsole Groovy script. To use it, simply start RSConsole and run the following command:
cd runbook
From here, you have two general methods to convert ".Docx" files into Impex modules: either single file or bulk file conversion:
DocxToImpexConverterBulkFile.groovy
DocxToImpexConverterSingleFile.groovy
Single File Conversion
To convert a single ".Docx" file into a Actions Pro Impex module, run the following command and parameters:
DocxToImpexConverterSingleFile "<source file>" <namespace> <wiki document name> "<destination file>"
- source file: The absolute path to the ".docx" file; must be wrapped in quotation marks.
- namespace: The name of the namespace associated with the exported Runbook.
- wiki document name: The name of the runbook associated with the exported Runbook.
- destination file: The absolute path to the destination zip file or directory once the export occurs; must be wrapped in quotation marks.
Example: DocxToImpexConverterSingleFile "C:/test/my test.docx" sysTestRunbookName "C:/test/test-export.zip"
Bulk File Conversion
To convert an entire directory of ".docx" files into a single Impex file, run the following command and parameters:
DocxToImpexConverterBulkFile "<source directory>" <namespace>"<destination file>"
- source directory: The absolute path to the directory of ".docx" files; must be wrapped in quotation marks. The bulk conversion command supports either a source directory or filename (see screenshot below).
- namespace: The name of the namespace associated with the exported Runbooks.
- destination file: The absolute path to the destination zip file; must be wrapped in quotation marks.
The Runbook names for each ".docx" file will be the file name of the ".docx" file.
Example:
DocxToImpexConverterBulkFile "C:/test/My Docx Files" sys"C:/test/test-export.zip"
Limitations
Due to server data type restrictions, UTF-8 Unicode characters with hash values above 127 will be excluded from the conversion. These include white space characters, special bullet points, and related characters.
Once Conversion is Complete
After converting your ".docx" files, you should see a "Conversion results" list describing the files that were converted successfully. There may be some internal formatting errors in the ".docx" file, which could result in an unsuccessful conversion.
The conversion process will output a ".zip" file, which you can then upload through the Actions Pro Import/Export Module function in the Import-Export main menu.
Impex How-To and Troubleshooting
A few troubleshooting and how-to operations are related to import/export modules:
Bulk Import of Attachments
This utility imports bulk attachments to Wiki Documents. You should be able to pass multiple folders and files to the same file in one ESB request. Note that the token is '|' (pipe or vertical line). Here is the snippet of the ActionTask that imports attachments.
1 Def paramos = new Hash Map()
2 params.put("Runbook.Test5", "C:/project/resolve3/dist./tmp/system.zip");
3 params.put("[Runbook.CO](http://Runbook.CO) Equipment", "C:/project/resolve3/dist./tmp");
4 params.put("Runbook.Extjs1", "C:/project/resolve3/dist/tmp:/project/resolve3/dist/tomcat/LICENSE|C:/project/resolve3/dist/lib/activation.jar");
5 ESB.sendMessage('RSVIEW', 'MWiki.importBulkAttachments', param);
Code Example Module Export
This code example shows how to export a module using the ESB in the assessor of an ActionTask.
Exporting a non-existent module name will fail silently. Be careful!
1 import com.resolve.esb.MMsgOptions
2
3 def condition = "good"
4 def severity = "good"
5 def summary = ""
6 def detail = ""
7
8 def module String = INPUTS["MODULE_LIST"] //Comma separated list of modules to export. This is required!
9 def module List = moduleString.split(",") //Modules are comma separated
module List = moduleList.collect {
it.trim() //Trims off whitespace from the name of each module
12 }
13
14 detail += "MODULE_LIST: '${module String}'\n"
15 detail += "Parsed Modules:\n"
16 def fixedModuleString = ""
17 moduleList.each {
18if(it.trim()) {
19 fixedModuleString += it + ','
20 detail += "\t'${it}'\n"
21}
22 }
23
24 if(fixedModuleString. Size() > 1) {
25fixedModuleString = fixedModuleString[0..-2] //Remove the last character of the fixedModuleString (it's an extra comma)
26detail += "Formatted Input String: '${fixedModuleString}'\n"
27def params = [(Constants.IMPEX_PARAM_MODULENAME):fixedModuleString];
28MMsgOptions options = new MMsgOptions()
29options.setDelay(5)
30ESB.sendMessage("RSVIEW", "MAction.exportModule", options, params); //This is the one line that sends off the request! Import/export syntax is pretty much the same, just change the second parameter
31detail += "ESB message sent with params: '${params.toString()}'"
32 }
33 else {
34condition = "bad"
35severity = "critical"
36summary = "Bad module list"
37detail += "Bad module list (no modules could be parsed from: '${module String}') aborting..."
38 }
39
40 RESULT. Condition = condition
41 RESULT. Severity = severity
42 RESULT. Summary = summary
43 RESULT. Detail = detail
Exporting and Importing KM documents to Backup Server
Documentation for the Runbooks that export client knowledge and import it to the backup server.
Two Runbooks copy changed KM documents hourly and upload all nightly. The km.exportKMdelta Runbook identifies the documents that have been modified in the last hour and copies each to the backup server. While the km.exportdaily Runbook is running as a standalone Runbook, it copies the complete KM platform (application pages and documents) to the backup system.
The km.exportKMdelta Runbook consists of three ActionTasks which pass information into the km.exportdaily Runbook. There is no configuration required of the ActionTasks related to the km.exportKMdelta Runbook.
The km. exportdaily Runbook consists of six Runbooks. All of these Runbooks require the creation of properties within the Action Definition Component in the initial configuration. The backup server IP address (SERVER), port (PORT), server username (USERNAME), server password (PASSWORD - Encrypted), Actions Pro admin username (IMPUSERNAME), Actions Pro admin password (IMPOPASSWORD - Encrypted), and rsexpert directory (FILEDIR).
km.exportKMdelta Runbook
This Runbook consists of automation that creates an Import/Export module and populates the module with documents modified in the last hour. The module gets passed to the km. exportdaily Runbook which transfers the file to a specified backup server and imports it into the backup system.
- ActionTask:
HE-exportModuleDef
- Create the Import/Export Module. The name created is km.ExportHour-MDYYYYHH. An example when the run on May 8, 2012 at 08:00: km.ExportHour-5820128. This is the MODNAME. The MODSYSID is generated at the time of creation.- OUTPUTS(FLOWS): MODNAME
- OUTPUTS(FLOWS): MODSYSID
- ActionTask:
HE-selectKMs
- Generate a list of KMs based on a query that looks for sys_updated_on times that is 1 hour old and newer.- OUTPUTS(FLOWS): FILELIST
- OUTPUTS(FLOWS): FILESYSID
- ActionTask:
HE-populate Export
- Updates the created module with the file listing.- INPUTS: MODNAME
- INPUTS: MODSYSID
- INPUTS: FILELIST
- OUTPUTS(FLOWS): MODNAME
km.exportdaily Runbook
This Runbook consists of automation to export an identified module, transfer the output to a backup server, and import the backup into the system.
ActionTask:
exportModules
- Take the import/export module provided by the MODULE_LIST and performs the export. If there is no input for the MODULE_LIST, MODULE_DEFAULT is used in its place. The output of the file is provided as the OUTPUT.- INPUTS: MODULE_LIST
- INPUTS: MODULE_DEFAULT
- OUTPUTS(FLOWS): FILENAME
ActionTask:
connectSSH
- Connect to the server and port provided with the username and password supplied. The password is encrypted. When the connection has been made, the connection information is stored in the SESSIONS variable to be utilized in other areas. A default username, password, server, and port are stored and not passed in at this point in time.PROPERTY: USERNAME
PROPERTY: PASSWORD
PROPERTY: SERVER
PROPERTY: PORT
SESSIONS
Ensure that the USERNAME, PASSWORD, SERVER, and PORT are all configured to match the login information for the backup system.
ActionTask:
transfer Back
- SCP the file identified from the export modules to the identified directory. Utilize the SESSIONS variable to acquire the connection.INPUTS: FILENAME
PROPERTY: FILEDIR
SESSIONS
Validate the FILEDIR location for the backup server.
ActionTask:
remote Import
- Accesses the remote system and imports the identified FILENAME into the remote Actions Pro platform.PROPERTY: IMPPASSWORD
PROPERTY: IMPUSERNAME
INPUTS: FILENAME
SESSIONS
Ensure that a user with the Actions Pro administrative access is entered.
ActionTask:
close
- This closes the session related to the Runbook. The database is closed and the session is released.
Export Module via Schedule
This section includes details on how to set up a scheduled job for exporting module.
- Select New for Cron Scheduler under Scheduler in the navigation menu and enter fields to export module's.
- To export just one module, Values:
- Runbook: RSVIEWS#MAction.exportModule
- Parameters: MODULENAME=RSQA
An alternative is to export more than one module same time:
- Runbook: RSVIEWS#MAction.exportModule
- Parameters: MODULENAME=RSQA, support
The module will be exported to the rsexpert folder.
Import CSV Data into Custom Table
This document shows how to use RSConsole to import table data from a CSV file.
The Custom Table should be defined ahead of time. The CSV should be formatted such that the first line contains the table column names, and each subsequent line contains comma-separated values that correspond with each column.
To import data from a CSV:
- Start rsconsole
- Connect to RSMgmt queue
- Execute impex/ImpexCustomTable with appropriate parameters
Actions Pro will automatically generate values for sys columns if they are not present in the CSV. If values for mysid are present and they conflict with existing entries in the table, they will not be inserted unless 'override=true' is passed (see Parameters below).
It can be helpful to tail the RSMgmt logs during import to check for errors.
The following detail can be viewed in rsconsole by executing impex/ImpexCustomTable without any parameters:
Usage: ImpexCustomTable import-export table=<table name> file=<full path to CSV file> [datatype=csv] [delim=<custom delimiter>] override=true false]
Performs custom table data import from a file or export to a file.
Parameters:
Import
orexport
– indicates the operation you are performing.table=<table name>
- the name of the database table.file=<full path to CSV file>
- the absolute path to the CSV file to read data during "import", or write data during "export".datatype=csv|xls
– optional parameter that indicates the data type of the file, default is CSV.delim=<custom delimiter>
- optional parameter that indicates the delimiter, if not supplied uses comma(,).override=true|false
– optional parameter that indicates during the import if you want to override the data if the same mysid is found, default is truestoponfailure=true|false
– optional parameter that indicates during the import if there is data error should it stop processing further? Default is false
Examples:
ImpexCustomTable import table=my_table file=/tmp/my_data_imp.csv override=false
ImpexCustomTable export table=my_table file=/tmp/my_data_exp.csv
ImpexCustomTable export table=my_table file=/tmp/my_data_exp.xls datatype=xls
Example
This example uses a simple custom table called csv_impex_example, with columns u_first, u_second, and u_third.
The contents of the CSV that will be imported:
- u_first,u_second,u_third
- a,b,c
- d,e,f
- g,h,i
- j,k,l
In RSConsole, run the following commands:
connect RSMGMT
impex/impexcustomtable import table=csv_impex_example file=/tmp/my_data_exp2.csv
The RSMgmt log will include details about the import.
Screenshot of the table after import: